<!DOCTYPE html>
<html>
<head>
    <title>商品搜索推荐表</title>
    <#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <form class="form-inline" role="form">
                <div class="form-group">
                    <a @click="reset"><i class="fa fa-refresh"></i></a>
                </div>&nbsp;&nbsp;&nbsp;
                <div class="form-group">
                    <a class="btn btn-primary btn-sm" @click="query"><i class="fa fa-search"></i>&nbsp;查询</a>
                    <input type="text" class="form-control input-sm" v-model.trim="q.name" placeholder="商品名称">
                </div>
                <#if shiro.hasPermission("goodsPush:goodspush:save")>
                <a class="btn btn-primary btn-sm" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
            </#if>
            <#if shiro.hasPermission("goodsPush:goodspush:update")>
            <a class="btn btn-primary btn-sm" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
        </#if>
        <#if shiro.hasPermission("goodsPush:goodspush:delete")>
        <a class="btn btn-primary btn-sm" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
    </#if>
    </form>
</div>
<table id="jqGrid"></table>
<div id="jqGridPager"></div>
</div>

<div v-show="!showList" class="panel panel-default" align="center">
    <div class="panel-heading">{{title}}</div>
    <form class="form-horizontal">
        <div class="form-group" v-if="title=='新增'">
            <div class="col-sm-2 control-label"><span style="color: red">*&nbsp;</span>商品名称</div>
            <div class="col-sm-10">
                <el-select clearable style="padding-right: 180px;width: 550px;" v-model.trim="goodsPush.name"
                           filterable remote reserve-keyword placeholder="商品名称"
                           :remote-method="remoteMethod" :loading="loading">
                    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
                </el-select>
            </div>
        </div>
        <!--<div class="form-group">-->
            <!--<div class="col-sm-2 control-label">GoodsID</div>-->
            <!--<div class="col-sm-10">-->
                <!--<input type="number" class="form-control input-sm" v-model.trim="goodsPush.goodsId" placeholder="GoodsID" readonly/>-->
            <!--</div>-->
        <!--</div>-->
        <div class="form-group" v-if="title=='修改'">
            <div class="col-sm-2 control-label">商品名称</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model.trim="goodsPush.name" placeholder="商品名称" readonly/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label"><span style="color: red">*&nbsp;</span>权重:设置数值越大排越前</div>
            <div class="col-sm-10">
                <input type="number" class="form-control input-sm" v-model.trim="goodsPush.pushWeight" placeholder="权重：设置数值越大排越前" />
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">应用到搜索</div>
            <div class="col-sm-10">
                <select v-model="goodsPush.searchFlag" class="form-control input-sm">
                    <option value=true>是</option>
                    <option value=false>否</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">应用到分类</div>
            <div class="col-sm-10">
                <select v-model="goodsPush.categoryFlag" class="form-control input-sm">
                    <option value=true>是</option>
                    <option value=false>否</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label"></div>
            <input type="button" class="btn btn-primary  btn-sm" @click="saveOrUpdate" value="确定" />
            &nbsp;&nbsp;<input type="button" class="btn btn-warning  btn-sm" @click="reload" value="返回" />
        </div>
    </form>
</div>
</div>

<script src="${request.contextPath}/statics/js/modules/business/goodspush.js?_${.now?long}"></script>
</body>
</html>
